package org.martin.snsrs.actions;

import java.util.List;

import org.martin.snsrs.beans.Activity;
import org.martin.snsrs.beans.User;
import org.martin.snsrs.beans.UserComment;
import org.martin.snsrs.daos.ActivityDao;
import org.martin.snsrs.services.UserServices;

public class GetActivityDetail extends UserBase{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 7567566178900352506L;

	private ActivityDao activityDao;
	
	private UserServices userServices;
	
	private Integer activityID;
	
	private List<UserComment> comments;
	
	private String activityDesc;
	
	private String activityName;
	
	private User createUser;
	
	private String location;
	
	private String sessionKey;
	
	private boolean isValidate;
	
	public void validate(){
		if(sessionKey == null){
			status = "error";
			errorReason = "未知用户";
			isValidate = false;
			return;
		}
		if(activityID == null){
			status = "error";
			errorReason = "未知活动";
			isValidate = false;
			return;
		}
	}
	
	public String execute(){
		Activity activity = activityDao.getActivity(activityID);
		activityDesc = activity.getActivityDesc();
		activityName = activity.getActivityName();
		
		return SUCCESS;
	}

	public ActivityDao getActivityDao() {
		return activityDao;
	}

	public void setActivityDao(ActivityDao activityDao) {
		this.activityDao = activityDao;
	}

	public UserServices getUserServices() {
		return userServices;
	}

	public void setUserServices(UserServices userServices) {
		this.userServices = userServices;
	}

	public Integer getActivityID() {
		return activityID;
	}

	public void setActivityID(Integer activityID) {
		this.activityID = activityID;
	}

	public List<UserComment> getComments() {
		return comments;
	}

	public void setComments(List<UserComment> comments) {
		this.comments = comments;
	}

	public String getActivityDesc() {
		return activityDesc;
	}

	public void setActivityDesc(String activityDesc) {
		this.activityDesc = activityDesc;
	}

	public String getActivityName() {
		return activityName;
	}

	public void setActivityName(String activityName) {
		this.activityName = activityName;
	}

	public User getCreateUser() {
		return createUser;
	}

	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getSessionKey() {
		return sessionKey;
	}

	public void setSessionKey(String sessionKey) {
		this.sessionKey = sessionKey;
	}

}
